package com.dante.mvp_login.model;

import java.util.HashMap;
import java.util.Map;

/**
 * 类说明：
 * 作者：HD on 2017/11/17 16:19
 * 邮箱：hehandong@qq.com
 */

public class UserModel implements IUserModel {

    private Map<String,String> userMap = new HashMap<>();
    @Override
    public boolean onRegister(String name, String pwd) {
        if (!userMap.containsKey(name)){
            userMap.put(name,pwd);
            return true;
        }
        return false;

    }

    @Override
    public boolean onLogin(String name, String pwd) {
        return pwd.equals(userMap.get(name));

    }
}
